package db

const TableNameTypeCardDonate = TablePrefix + "type_card_donate"

type TypeCardDonate struct {
	BaseModel
	TypeID uint  `gorm:"column:type_id;type:int(11);default:0;comment:商品id" json:"type_id" form:"type_id"`  //商品id
	Type   int   `gorm:"column:type;type:int(3);default:0;comment:1=游戏角色2=装备碎片" json:"type" form:"type"`    //1=游戏角色2=装备碎片
	LinkID uint  `gorm:"column:link_id;type:int(11);default:0;comment:关联的id" json:"link_id" form:"link_id"` //关联的id
	Num    int64 `gorm:"column:num;type:int(11);default:0;comment:数量" json:"num" form:"num"`                //数量
	Odds   int64 `gorm:"column:odds;type:int(11);default:0;comment:数量" json:"odds" form:"odds"`             //概率
}

func (*TypeCardDonate) TableName() string {
	return TableNameTypeCardDonate
}

type TypeCardDonateHaxOneTypeOfRole struct {
	TypeCardDonate
	LinkType Type         `gorm:"foreignKey:ID;references:LinkID" json:"linkType"`
	LinkRole GameRolePool `gorm:"foreignKey:ID;references:LinkID" json:"linkRole"`
}
